﻿
@{
    ViewBag.Title = "Index";
}

<script type="text/javascript">
    $(function () {
        var t = $("#table1").datagrid({
            title: '外接应用系统管理 - 列表查看',
            fit: true,
            method: 'post',
            idField: 'Key',
            url: "/Application/Details",
            //data: {"total":15,"rows":[{"Code":"04D82387-FE10-43E3-942A-4DD4F6F63049","Name":"测试系统11","Summary":null,"Remark":null,"ID":1,"Key":"04d82387-fe10-43e3-942a-4dd4f6f63049","Flag":0,"CreateDate":new Date(1414569361893),"CreateUserID":0,"ModifyDate":new Date(1414572964798),"ModifyUserID":0},{"Code":"1B59F2B5-BC51-49D7-A713-21B9FE6FBE7A","Name":"测试系统10","Summary":null,"Remark":null,"ID":2,"Key":"1b59f2b5-bc51-49d7-a713-21b9fe6fbe7a","Flag":0,"CreateDate":new Date(1414569361893),"CreateUserID":0,"ModifyDate":new Date(1414572964798),"ModifyUserID":0},{"Code":"5F87FB09-2C0B-44BE-8181-EF8B6D6EEE2C","Name":"测试系统12","Summary":null,"Remark":null,"ID":3,"Key":"5f87fb09-2c0b-44be-8181-ef8b6d6eee2c","Flag":0,"CreateDate":new Date(1414569361893),"CreateUserID":0,"ModifyDate":new Date(1414572964798),"ModifyUserID":0},{"Code":"6CEE5DA0-A554-44CD-9F17-3F04D07A3026","Name":"测试系统05","Summary":null,"Remark":null,"ID":4,"Key":"6cee5da0-a554-44cd-9f17-3f04d07a3026","Flag":0,"CreateDate":new Date(1414569361893),"CreateUserID":0,"ModifyDate":new Date(1414572964798),"ModifyUserID":0},{"Code":"71851240-6A47-47FC-86BE-6F61BA9063FB","Name":"测试系统07","Summary":null,"Remark":null,"ID":5,"Key":"71851240-6a47-47fc-86be-6f61ba9063fb","Flag":0,"CreateDate":new Date(1414569361893),"CreateUserID":0,"ModifyDate":new Date(1414572964798),"ModifyUserID":0},{"Code":"73BC70A9-12DB-4705-8727-DCEA83C6BBAE","Name":"测试系统14","Summary":null,"Remark":null,"ID":6,"Key":"73bc70a9-12db-4705-8727-dcea83c6bbae","Flag":0,"CreateDate":new Date(1414569361893),"CreateUserID":0,"ModifyDate":new Date(1414572964798),"ModifyUserID":0},{"Code":"A5A1C7B2-8D8B-4F66-A972-5447881975BA","Name":"测试系统06","Summary":null,"Remark":null,"ID":7,"Key":"a5a1c7b2-8d8b-4f66-a972-5447881975ba","Flag":0,"CreateDate":new Date(1414569361893),"CreateUserID":0,"ModifyDate":new Date(1414572964798),"ModifyUserID":0},{"Code":"A77519F0-7CD6-4934-AFDE-DE990F3393F1","Name":"测试系统08","Summary":null,"Remark":null,"ID":8,"Key":"a77519f0-7cd6-4934-afde-de990f3393f1","Flag":0,"CreateDate":new Date(1414569361893),"CreateUserID":0,"ModifyDate":new Date(1414572964798),"ModifyUserID":0},{"Code":"B04708BA-A962-41ED-B682-61EB661AB909","Name":"测试系统09","Summary":null,"Remark":null,"ID":9,"Key":"b04708ba-a962-41ed-b682-61eb661ab909","Flag":0,"CreateDate":new Date(1414569361893),"CreateUserID":0,"ModifyDate":new Date(1414572964798),"ModifyUserID":0},{"Code":"B29E6310-2AC8-4428-809C-42E04F4CF7E5","Name":"测试系统04","Summary":null,"Remark":null,"ID":10,"Key":"b29e6310-2ac8-4428-809c-42e04f4cf7e5","Flag":0,"CreateDate":new Date(1414569361893),"CreateUserID":0,"ModifyDate":new Date(1414572964798),"ModifyUserID":0}]},
            remoteSort: false,
            rownumbers: true,
            pagination: true,
            frozenColumns: [[
                { field: 'ck', checkbox: true },
                { field: 'Key', title: 'Key', width: 120, hidden: true },
            ]],
            columns: [[
                { field: 'Code', title: '应用系统编码', align: 'center', width: 240 },
                { field: 'Name', title: '应用系统名称', align: 'center', width: 140 },
                { field: 'Flag', title: '状态', align: 'center', width: 120 },

                { field: 'CreateDate', title: '创建日期', align: 'center', width: 160 },
                { field: 'CreateUserID', title: '创建用户', align: 'center', width: 100 },
                { field: 'ModifyDate', title: '最后修改日期', align: 'center', width: 160 },
                { field: 'ModifyUserID', title: '最后修改用户', align: 'center', width: 100 }
            ]],
            toolbar: [
                {
                    text: "增加", iconCls: "icon-add", handler: function () {
                        
                    }
                },
                {
                    text: "修改", iconCls: "icon-edit", handler: function () {
                        var rows = t.datagrid("getSelections");
                        if (!rows || !rows.length || rows.length > 1) {
                            return $.messager.show({ title: "操作提醒", msg: "请选择且仅选择一行数据" });
                        }
                        
                    }
                },
                {
                    text: "删除", iconCls: "icon-remove", handler: function () {
                        var rows = t.datagrid("getSelections");
                        if (!rows || !rows.length) {
                            return $.messager.show({ title: "操作提醒", msg: "请至少选择一行数据" });
                        }
                        $.messager.confirm("操作提醒", "您确认要删除选中的这 " + rows.length + " 行数据？", function (c) {
                            if (c) {
                                alert("delete");
                            }
                        });
                    }
                }
            ]
        });

        $("#btnSearch").click(function () {
            t.datagrid("load", { appName: $("#appName").val() });
        });
    })
</script>

<div class="easyui-panel" data-options="fit: true, noheader: true, border: false" style="padding: 20px;">

    <div class="easyui-layout" data-options="fit: true">

        <div data-options="region: 'north', border: false, noheader: true, split: false" style="height: 110px;">
            <h2>外接应用系统管理 - Index</h2>
            <hr />
            <label for="appName">应用系统名称：</label>
            <input id="appName" name="appName" type="text" />
            <a id="btnSearch" href="javascript: void(0);" class="easyui-linkbutton" data-options="iconCls: 'icon-search'">查询</a>
            <hr />
        </div>

        <div data-options="region: 'center', border: false">
            <table id="table1"></table>
        </div>

    </div>

</div>




